<?php

namespace S3\Sample2Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class DefaultController extends Controller
{
    /**
     * @Route("/hello/{name}")
     * @Template()
     */
    public function indexAction($name)
    {
        return array('name' => $name);
    }
    
    /**
     * @Route("/test-params/{param1}")
     * @Template("S3Sample2Bundle:Default:test_params.html.twig")
     */
    public function testAction($param1)
    {
        return array('param1' => $param1);
    }
    
    /**
     * @Route("/test-param2/{param3}/{default_param}", 
     *          requirements={"default_param"="\d+"}, 
     *          defaults={"default_param" = "my default string"}
     * )
     * @Template("S3Sample2Bundle:Default:test_params2.html.twig")     
     */
    public function test2Action($param3, $default_param)
    {
        return array(
            'custom_param' => $param3,
            'default_param' => $default_param
        );
    }
}
